<html>

<head>
	<title>闲瓜市场 - 详情</title>
	<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
	<link rel="stylesheet" type="text/css" href="{{url_for('static',filename='templates/briefing.css')}}" />
	<script src="{{url_for('static',filename='js/briefing.js')}}"></script>
	<script src="{{url_for('static',filename='js/global.js')}}"></script>
</head>

<body onload="onLoad('{{info['gid']}}','{{info['seller_name']}}','{{info['seller_id']}}')">
	<nav class="nav">
		<div class="navHerf" id="toFrontPage"><a href="/">首页</a></div>
		<div class="navHerf" id="toLoginPage"><a href="/login">登录</a></div>
		<div class="navHerf" id="toRegPage"><a href="/register">注册</a></div>
		<div class="navHerf" id="toUploadPage"><a href="/upload_new">添加商品</a></div>
		<div class="navUser" id="curUser"><a href="/myinfo">未登录</a></div>
	</nav>
	<div class="main">
		<div id="info">
			<div id="itemImage">
				<img id="img" src="{{info['img_src']}}">
			</div>
			<div id="itemInfo">
				<div onclick="gotoSellerInfo({{info['seller_id']}})">
					<span id="sellerNmae">{{info['seller_name']}}</span>
				</div>
				<div>
					<h3 id="goodsName">{{info['name']}}</h3>
				</div>
				<div>
					<span id="RMB">￥</span>
					<span id="goodsPrice">{{info['price']}}</span>
				</div>
				<div>
					<span id="goodsDescription">{{info['des']}}</span>
				</div>
				<div id="briefButtons">
					<input class="redBnt" type="button" name="buy" value="购买" onclick="buy()">
					<input class="orangeBnt" type="button" name="like" value="收藏" onclick="like()">
					{% if aut == 3 %}
					<input class="delBnt" type="button" name="like" value="删除" onclick="removeGoods({{info['gid']}})">
					{% endif %}
				</div>
			</div>
		</div>
		<div id="comment">
			<div id="commentTitle">
				<span id="pinglun">评论</span>
				<span id="commentNum">0</span>
			</div>
			<ul id="commentList">
				{% for c in comment %}
				<li>
					<div>
						<span class="commenterNmae">{{c['commenter']}}</span>
						{% if c['commenter'] == info['seller_name'] %}
						<span class="sellerTag">卖家</span>
						{% endif %}
						{% if c['replyto'] != None %}
						<span>回复</span>
						<span class="commenterNmae">{{c['replyto']}}</span>
						{% endif %}
						<span class="commentDate">{{c['time']}}</span>
					</div>
					<p class="commentText">{{c['text']}}</p>
					<div class="del">
						{% if aut == 3 or aut == 2 or c['commenter'] == name %}
						<input class="delBnt" type="button" value="删除" onclick="removeComment('{{c['cid']}}','{{c['commenter']}}')">
						{% endif %}
						<!-- <input type="button" value="回复" onclick="setReply('{{c['cid']}}','{{c['commenter']}}')"> -->
					</div>
					<hr>
				</li>
				{% endfor %}
			</ul>
			<div id="input">
				<div id="commentDiv">
					<input id="commentIn" type="text" name="comment" placeholder="期待你的精彩评论..." maxlength="200"></input>
				</div>
				<div>
					<input class="orangeBnt" id="commentSubmit" type="button" value="提交" onclick="submitComment()">
				</div>
			</div>
		</div>
	</div>
</body>

</html>